package cn.vehicle.constants;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;

import java.io.File;
import java.util.Date;

public class Constants {

    public static final String GOV_SUCCESS_CODE = "200";
    public static final String SYSTEM_OPERATOR = "SYSTEM";


    public static final String PICTURE_FILE_DETECTED_PATH = String.join(File.separator, getOsName(), "vehicle-access", getNowDayStr(), "picture", "detected");
    public static final String PICTURE_FILE_LEDGER_PATH = String.join(File.separator, getOsName(), "hj", "vehicle-access", getNowDayStr(), "picture", "ledger");
    public static final String VIDEO_FILE_PATH = String.join(File.separator, getOsName(), "hj", "vehicle-access", getNowDayStr(), "video");


    public static final String PICTURE_FILE_SNAP_PATH = String.join(File.separator, getOsName(),"hj", "vehicle-access", getNowDayStr(), "picture", "snap");



    public static String getNowDayStr(){
        return DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN);
    }

    public static String getOsName() {
        String property = System.getProperty("os.name");
        if (property.contains("Windows")) {
            return "D:";
        } else {
            return System.getProperty("user.home");
        }
    }
}
